{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## sparse稀疏向量生成\n",
    "\n",
    "如何用ollama调用bge-m3生成sparse vector？\n",
    "\n",
    "从此贴可以看到ollama并没有回应这个功能需求。https://github.com/ollama/ollama/issues/6230\n",
    "\n",
    "因此，我们需要使用BGE的库来支持获取稀疏向量。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "embedding=[-1.499535322189331, 0.9581911563873291, -1.075727939605713, -1.4402531385421753, -1.0342369079589844, 0.738634467124939, -0.4252665042877197, 1.259601354598999, 0.6361695528030396, -0.27363884449005127, -0.5769347548484802, 0.4512048363685608, 0.18400581181049347, 0.6901289820671082, 0.6486800909042358, -0.9261811971664429, 0.9211224913597107, 0.4176890254020691, 0.2601049542427063, 0.19217537343502045, -0.2858060598373413, 0.20656979084014893, -1.6138116121292114, 0.9223015308380127, -0.48134222626686096, 0.4669092297554016, 0.16878412663936615, -0.3289545178413391, 0.5935918688774109, 0.3587874174118042, -0.2980130612850189, 0.2335677444934845, -0.4851650893688202, -0.2598167657852173, -0.7169774174690247, -0.09795261919498444, -0.8453382849693298, 0.3162927031517029, -0.8078286647796631, 0.19459986686706543, -0.1941232532262802, -0.510180652141571, 1.1003726720809937, -0.08919207751750946, 0.16786272823810577, -0.8741812705993652, -0.25126171112060547, -0.8362108469009399, -1.5041005611419678, -1.2924902439117432, -0.3991990387439728, 0.2646919786930084, 1.801303744316101, -1.462144136428833, 0.15067212283611298, -0.6506344676017761, 0.8427069783210754, -1.306345820426941, -0.6832844018936157, -0.6156150102615356, -0.5654330253601074, -0.24672189354896545, -1.2539325952529907, -0.938205361366272, -0.06534621864557266, 2.5120880603790283, 0.653409481048584, 0.3577830493450165, -0.42195773124694824, -0.8782011866569519, -1.358953833580017, 0.22799906134605408, -0.04312949627637863, -0.2913762331008911, -2.1121835708618164, 0.1237805187702179, -0.34201160073280334, -0.5193026065826416, -0.2749478816986084, 0.48505228757858276, 2.228886365890503, 0.5876572132110596, -0.36686792969703674, 0.41393792629241943, -0.37627458572387695, 0.9600461721420288, -0.7273267507553101, 0.24721696972846985, -0.43820542097091675, -1.4900263547897339, -0.753078043460846, 0.9102460145950317, -0.3978080451488495, -0.6734669208526611, 0.09417616575956345, 0.2500928044319153, -0.9792178869247437, -0.20916782319545746, 0.3558828830718994, 0.9656041860580444, 0.5312854647636414, -0.6565786600112915, -0.6793405413627625, -0.8519825339317322, 0.29052969813346863, -0.6216697096824646, 1.6611106395721436, 0.4523496627807617, -0.23214323818683624, 0.977828323841095, 1.0677440166473389, 1.196582555770874, 0.03859739750623703, -0.04916568100452423, -0.22210060060024261, -0.13206535577774048, -0.4004368484020233, -0.2853339910507202, -0.5053089261054993, 0.6311413049697876, 0.7412161231040955, 1.4716930389404297, 0.261487752199173, -0.5024542808532715, -0.28643345832824707, -0.23022021353244781, -0.0028956830501556396, 1.8257800340652466, 0.07295146584510803, 0.4475524127483368, -0.37678974866867065, 0.6926140785217285, -1.3606560230255127, 0.7174469232559204, -0.9973065853118896, 0.03207856044173241, 0.08412952721118927, -0.3566436171531677, 0.5255400538444519, -0.9332982301712036, 1.4777014255523682, 1.4944276809692383, 0.059125661849975586, -0.1630256325006485, 0.561672031879425, 0.28092560172080994, 0.5610406398773193, 0.24632099270820618, -0.19480185210704803, 0.6282016038894653, -1.2352020740509033, 0.23631294071674347, 0.9293586015701294, 1.1076215505599976, -1.3396209478378296, -0.07323191314935684, -0.9505330920219421, 0.6451778411865234, -0.7307856678962708, 1.4043128490447998, 0.49532103538513184, 0.32661330699920654, -1.036569595336914, 0.01904468610882759, -0.5715931057929993, 0.274027556180954, 1.0489771366119385, 1.4702621698379517, -0.04257681965827942, -0.1034262552857399, 0.2822061777114868, 0.182106152176857, 0.23842304944992065, -0.282348096370697, 0.5534120798110962, 0.4919434189796448, 1.0512219667434692, -0.24795284867286682, 0.24175617098808289, -0.5322545766830444, -1.4181593656539917, -0.8036375045776367, -0.3776451051235199, -0.21037344634532928, -0.8575753569602966, 0.1789851188659668, 0.7680445313453674, -0.5585411190986633, 0.4730895757675171, 0.5747525691986084, 0.16134150326251984, -0.2347666323184967, 0.5991379618644714, -0.7027864456176758, 1.2309314012527466, -0.18190255761146545, 0.6390900015830994, -1.3980884552001953, 0.6760823130607605, -0.44950610399246216, -0.006829158402979374, -0.31890106201171875, 1.7956840991973877, -0.31386053562164307, -0.4659934639930725, 0.4765464663505554, -2.0767369270324707, -1.5863605737686157, 0.8960555195808411, -0.24246783554553986, -0.29226645827293396, -0.5029301047325134, 0.3156202733516693, -0.06800322234630585, -0.9910153150558472, -0.008125482127070427, 1.4437024593353271, 0.9003249406814575, 0.6240317821502686, -0.7873585224151611, -0.05662458389997482, 0.301386296749115, -0.704705536365509, 0.05836585909128189, 0.5214963555335999, 0.8642255067825317, 1.3228964805603027, 1.0694434642791748, -0.8654231429100037, -0.8765577673912048, -1.5557388067245483, -0.24277621507644653, -0.31283822655677795, 0.294359028339386, 1.374131679534912, -0.27783629298210144, -0.7721949815750122, 1.0971410274505615, 1.4279026985168457, 0.8334047198295593, -0.3648129105567932, -0.34943661093711853, -0.3289846181869507, 0.3932610750198364, -0.047590166330337524, 0.03011154569685459, -0.07517032325267792, -0.0951121598482132, -0.6267364025115967, -0.33057889342308044, 0.355277419090271, -0.09714559465646744, -1.3065184354782104, -0.5179468393325806, -0.07527997344732285, -0.19100716710090637, -0.07661087810993195, -0.26627546548843384, 1.3377268314361572, 0.5433592200279236, 0.6099580526351929, -0.5713293552398682, 0.41703930497169495, 0.6417337656021118, -0.0011679865419864655, -0.4657968580722809, 0.33514147996902466, 0.8858785629272461, -0.15898221731185913, -1.410747766494751, -0.7021409273147583, -0.11462973058223724, -0.20630550384521484, -0.070327527821064, 1.421744704246521, 0.6394138336181641, -0.20622305572032928, -0.11385012418031693, 0.16037261486053467, -0.4788478910923004, -0.07007116079330444, -0.20654670894145966, -0.0561261847615242, 0.36070916056632996, 0.27380380034446716, -0.7197161316871643, 0.7025344371795654, 1.0666961669921875, 0.48462316393852234, -0.07340408116579056, -0.8984480500221252, -1.1142916679382324, 1.806190013885498, 0.5496353507041931, 0.7731695771217346, 0.14606526494026184, -1.0351619720458984, -4.4761857986450195, 0.4895293116569519, 0.21855516731739044, -0.3103089928627014, 0.1645369678735733, -0.32207781076431274, -0.37602540850639343, 0.20969916880130768, 0.5574245452880859, -0.7471023797988892, -1.0079761743545532, -1.1674840450286865, 0.07913826406002045, -0.9987058043479919, -0.5225570201873779, -0.4824061393737793, -0.16844502091407776, -0.23840102553367615, 1.062690019607544, -0.9809256196022034, -0.5084793567657471, -0.3776172995567322, 1.363581895828247, -0.019749153405427933, -0.3589842915534973, -0.23703637719154358, -0.18841016292572021, 0.019126033410429955, -0.7218917012214661, -1.4931912422180176, 0.41361671686172485, -0.1325855553150177, -0.74222731590271, 0.9986006021499634, 0.40640464425086975, 0.9624703526496887, 0.38981541991233826, -0.6617536544799805, -0.2345881164073944, -0.14265993237495422, 0.18564468622207642, 0.24856016039848328, -0.7562614679336548, 0.11030362546443939, -0.04274335503578186, -0.5692445635795593, -0.733496367931366, -0.29569011926651, 0.6766855120658875, 0.07446247339248657, 0.4327099621295929, -1.1847691535949707, -0.015314213931560516, 0.30351096391677856, -0.7973563075065613, 0.9773337841033936, 0.2809273302555084, -0.2498469203710556, -0.46882712841033936, 1.031694769859314, -0.7236602902412415, -1.3052787780761719, 0.6508572697639465, 0.7930946350097656, 0.18592606484889984, 0.07136020064353943, 0.24568572640419006, 0.570819616317749, 0.6139354705810547, 0.8375901579856873, 0.5057743787765503, 0.4414673149585724, -0.23179639875888824, -1.1793711185455322, 0.039206407964229584, 0.6467527747154236, -1.198663353919983, -1.1126055717468262, -0.44589096307754517, -2.526550531387329, 0.35490113496780396, -0.5040216445922852, 0.6644185185432434, -0.19166691601276398, 0.08061395585536957, -0.16355915367603302, -0.33371832966804504, 0.07419964671134949, 0.8715649247169495, 4.920845985412598, 0.7640240788459778, 0.48146432638168335, -0.3145092725753784, 1.8577407598495483, -0.7375302314758301, 1.0908634662628174, -0.13443523645401, -0.5113492012023926, -1.0255308151245117, -1.3254776000976562, 0.2671632170677185, -0.10096273571252823, 0.42210543155670166, -0.6744478940963745, 1.0381520986557007, -0.7000336647033691, -0.2636840343475342, 1.4762985706329346, -0.38875812292099, 0.05984153598546982, 0.9999629259109497, 0.19625572860240936, 0.2668393850326538, -0.4839174747467041, -0.8124268651008606, -0.2631269693374634, 1.4643112421035767, 0.8126590847969055, 0.3117210865020752, -0.5237985849380493, 0.3111080527305603, 0.15837866067886353, 0.6951727867126465, 0.3785671591758728, 0.10206906497478485, 1.1949834823608398, -0.20426522195339203, 1.3845561742782593, 0.8642691373825073, -1.5798823833465576, -0.2270914912223816, -0.14987647533416748, -0.005928590893745422, 2.269929885864258, -0.2440132200717926, 0.7895031571388245, -2.0058016777038574, -1.1092207431793213, -0.25509050488471985, -0.8502159714698792, -0.19835150241851807, -0.7192704677581787, 0.7381964325904846, -1.8181368112564087, -0.7531419992446899, -1.4122381210327148, -0.1868422031402588, 0.339704692363739, -0.002468310296535492, 0.7653048634529114, 0.19638942182064056, -0.7458007335662842, -0.9424092769622803, 0.3238120377063751, -1.1560733318328857, -0.35402971506118774, -1.392342448234558, 0.8499330878257751, 0.5133776068687439, -0.384493350982666, 0.09142732620239258, -0.327150821685791, -0.11580993980169296, 0.883082389831543, 1.0111478567123413, -0.9546259641647339, 1.528376817703247, -0.23069633543491364, -1.5328506231307983, -0.2861921787261963, -0.4006487727165222, -0.18515823781490326, -0.17474964261054993, 0.3495331108570099, -0.3607026934623718, 0.8057180047035217, -0.5564928650856018, 0.1823064386844635, -0.1804429292678833, 0.32530486583709717, 0.6289809346199036, -1.4728962182998657, -0.17122520506381989, -0.40947043895721436, -0.23722800612449646, -0.8574396967887878, -0.8566310405731201, -1.3388592004776, 0.5667830109596252, 0.053812794387340546, -0.6382117867469788, -0.40402257442474365, -0.6537819504737854, -0.10608064383268356, -0.1428891122341156, 0.570375919342041, 0.44916900992393494, 0.23420798778533936, 0.47267216444015503, 1.0249024629592896, 0.5588483214378357, -0.4534119963645935, 0.5751921534538269, 0.7611846327781677, 1.1147478818893433, -0.2618275582790375, 0.051280513405799866, -0.10994835942983627, 0.7483817934989929, 0.28329941630363464, -1.623887538909912, 1.907327651977539, 0.5009149312973022, -1.603732943534851, 0.3676894009113312, 0.06726697087287903, 0.5231744647026062, -0.23790523409843445, 1.0325819253921509, -0.20066958665847778, -0.4910461902618408, -0.287029504776001, 0.14879287779331207, 1.0550317764282227, -0.06932345032691956, 1.252333402633667, 0.5666112303733826, 0.7189142107963562, 0.6862454414367676, 1.1859997510910034, -0.5433592200279236, 0.27256014943122864, -1.6706409454345703, -0.30903854966163635, 0.5098705291748047, 0.2829454243183136, -0.352803111076355, -0.5845504999160767, 0.6686514019966125, 0.8536227941513062, -0.07014572620391846, 1.1661709547042847, -0.5797545909881592, -0.1899958848953247, 0.08781030774116516, 0.536910891532898, 0.3099779486656189, -1.0361523628234863, -0.24121110141277313, -0.3577270209789276, 0.2026311606168747, 0.9253113269805908, 1.8091703653335571, -0.0809386745095253, 1.5722682476043701, -0.11374988406896591, -0.052272845059633255, 1.5992059707641602, -0.6341825723648071, 1.244713306427002, -0.2464037537574768, 0.2196843922138214, 1.0944128036499023, 0.951992392539978, -0.7890791893005371, -1.2074257135391235, 0.15302027761936188, -1.7813137769699097, 0.297988623380661, 1.086227297782898, 0.5034458637237549, 0.08357363939285278, 0.5760096311569214, 0.16854920983314514, 0.6916306018829346, -0.19024628400802612, -1.12274968624115, 0.6625263094902039, -0.9492798447608948, 0.1931602507829666, 2.0457606315612793, 0.08021026104688644, -0.2005920261144638, 1.3030346632003784, 0.7232841849327087, -0.5077409148216248, 1.1120775938034058, -0.7196047902107239, -0.9914588332176208, 0.9894185066223145, -0.6845830082893372, 0.5052918791770935, -0.8588747978210449, 0.6882430911064148, -0.08966302871704102, -0.40281933546066284, 0.2967234253883362, 0.09687171876430511, -0.7310680150985718, -1.276969313621521, -0.6103998422622681, -0.35316672921180725, 0.6019331216812134, -0.09058105945587158, 0.30556100606918335, 0.4514291286468506, -0.696276843547821, -0.2921525835990906, -0.7146279215812683, -0.5859575867652893, -0.39538314938545227, 1.707853078842163, -0.9539419412612915, -0.07369960844516754, 1.0637474060058594, -0.8673518896102905, -0.978966474533081, 0.6133919954299927, 0.40045979619026184, 0.21852083504199982, 0.31610944867134094, -0.6438853740692139, 0.003979640081524849, 1.109309196472168, -0.05659666657447815, -0.07867435365915298, 1.041046142578125, 0.18081915378570557, 0.002900782972574234, -1.3536347150802612, 0.4950036406517029, 0.3219866156578064, 1.188623309135437, -0.1996915340423584, 0.5283561944961548, -0.49516674876213074, -0.45902302861213684, 1.4263014793395996, 0.8190429210662842, 0.5451738238334656, 1.5179709196090698, 0.6402963399887085, -1.1370164155960083, -0.9479207992553711, -1.1458367109298706, 0.10697638988494873, 0.133893221616745, -0.14657719433307648, 0.31877362728118896, -0.5530036091804504, 0.3025650978088379, 0.3337855339050293, -0.8282428979873657, -0.6100185513496399, -0.6293131709098816, 1.1182352304458618, -0.4355497658252716, -0.2010829597711563, -1.0443000793457031, -0.9459842443466187, -0.08225132524967194, -0.8404051065444946, -0.2573719918727875, 0.10069532692432404, 0.4160742461681366, -0.7504998445510864, 1.2996805906295776, -0.21165113151073456, 0.09931040555238724, 0.12145544588565826, 1.0949106216430664, -1.770585536956787, 0.015897251665592194, 0.2917499542236328, -0.45427557826042175, 0.336950421333313, 0.11749531328678131, 0.6847161650657654, -0.3684259355068207, 0.27640649676322937, -0.7866569757461548, -0.14387984573841095, 0.6293585300445557, -0.6478007435798645, -0.46970775723457336, -0.7059285640716553, -0.3037080466747284, -0.20773392915725708, 0.18338806927204132, -0.5387991666793823, 0.5023005604743958, -0.7540552020072937, -0.6635658740997314, -0.8792890906333923, -0.14698493480682373, 0.07500799745321274, -1.3190009593963623, -0.17524200677871704, -0.2832763195037842, 0.9759763479232788, -0.5298968553543091, 1.6577050685882568, -1.4099783897399902, 0.28533506393432617, -0.1758141815662384, -0.4836694300174713, -0.674074113368988, -1.157534122467041, -0.24145644903182983, 0.1609891951084137, 0.19302958250045776, 0.22824783623218536, 0.5871022343635559, -0.14577354490756989, -0.2480017989873886, -2.00278377532959, -0.04104839265346527, -0.7271808981895447, 0.1312331110239029, 0.13095957040786743, -0.1067906990647316, 0.016376949846744537, 0.4304753839969635, 0.7474408745765686, -0.12014902383089066, -0.6696803569793701, 0.027717188000679016, 0.5944375395774841, -0.026576757431030273, 0.9565476179122925, 1.5803238153457642, -0.3020787239074707, -1.0563325881958008, 0.805265486240387, -0.6498630046844482, -0.45340362191200256, 0.5570882558822632, 0.7415530681610107, -0.06977048516273499, -0.5859466791152954, 1.1761415004730225, -0.28832435607910156, -0.699916422367096, 0.4910275340080261, 0.457194447517395, -0.5971375107765198, -1.5193183422088623, 0.5815183520317078, 0.7382948994636536, -0.6864790916442871, 1.698109745979309, -0.9095410108566284, 0.26165369153022766, -1.0146479606628418, 0.9107368588447571, -0.18104217946529388, 1.0197129249572754, -0.5454389452934265, -0.2777298092842102, 0.1681033968925476, 0.9814568758010864, 0.2572863698005676, -0.200575053691864, -0.007215951569378376, 0.7756801843643188, -1.2852859497070312, -0.6722936034202576, -0.03908178582787514, 1.0475780963897705, -0.12125043570995331, 0.2204151749610901, -0.6169426441192627, -0.6127899289131165, 0.5599912405014038, -1.3296149969100952, -0.21946558356285095, 0.27296367287635803, 0.6361501812934875, 0.34419721364974976, -1.3419709205627441, 0.1947263777256012, -1.431437611579895, -0.24706871807575226, -3.4940898418426514, 0.42498427629470825, -0.6878882050514221, -0.10125023126602173, -0.1319482922554016, -0.01814565435051918, -0.5084522366523743, -0.5918260216712952, -0.5726218223571777, -1.4712165594100952, 0.6171494722366333, 0.29158633947372437, -0.8845434784889221, -1.19699227809906, 0.4301513731479645, -0.647764265537262, 0.4957990050315857, 0.1080370619893074, 0.7546759247779846, 1.278343677520752, 0.15434403717517853, -0.41512584686279297, 1.1528319120407104, -0.11354579031467438, 0.08708249032497406, -0.35040348768234253, -0.2519698143005371, 0.621798038482666, -1.6550415754318237, -0.13897813856601715, -0.04710932821035385, 0.09684114158153534, 0.6832804679870605, 0.6555730104446411, -0.2655402421951294, 0.40454986691474915, -0.12132091075181961, 0.009502291679382324, 1.2832626104354858, -0.2426171451807022, -0.39558830857276917, 0.9524463415145874, -1.146329641342163, 1.2751209735870361, 1.1462918519973755, 1.1242597103118896, -0.8797996044158936, 0.006576031446456909, -0.3300493657588959, 0.6500147581100464, -0.5047149062156677, 1.068439245223999, 1.1890833377838135, 0.33001500368118286, -0.23034338653087616, 0.49798691272735596, -0.4249633252620697, -0.3781577944755554, 2.1634790897369385, 0.2967168390750885, -0.30346164107322693, 0.23534557223320007, -0.4432965815067291, -0.7454079985618591, 0.11587607860565186, 0.07932862639427185, -2.3874354362487793, 0.7528265118598938, 0.045846372842788696, 0.2971722185611725, -0.5644742846488953, 0.35224050283432007, 0.24661770462989807, -0.26177334785461426, 0.4823650121688843, 0.8320571184158325, 0.2103590965270996, 0.06043711304664612, -0.6077303290367126, -1.0860114097595215, 0.3106168508529663, -0.5362179279327393, -0.26252347230911255, -0.8129104375839233, 0.5189793705940247, 0.9508061408996582, -0.2416650801897049, -0.0589151456952095, -0.20686033368110657, -0.725780189037323, -3.09436297416687, -0.2859342396259308, -1.2215306758880615, 0.7250521779060364, -0.6464899182319641, 0.3463992476463318, -0.7790982127189636, -0.4001811444759369, -0.2389116883277893, 0.011255811899900436, -0.1737726926803589, -0.6963031888008118, 0.15389133989810944, -1.5208642482757568, -1.2645976543426514, -0.30871662497520447, 1.5432767868041992, 0.7210111021995544, 1.4845572710037231, -0.6670712232589722, -0.5371848344802856, -0.363790363073349, 0.1385822296142578, 0.04379062354564667, 0.6087504029273987, -0.08432820439338684, -0.3287315368652344, -1.695196509361267, -0.23892371356487274, 0.9363062977790833, 0.9497222304344177, 0.5185840725898743, 0.3133995234966278, -0.6019539833068848, -0.16326071321964264, -1.650662899017334, 0.8272496461868286, -0.29379385709762573, 1.166604995727539, -0.1274905800819397, 0.9904823303222656, -0.5753585696220398, -0.48982757329940796, 0.47837889194488525, 0.7872123718261719, 0.763579785823822, 0.6239392161369324, 0.14055801928043365, 0.20701345801353455, -0.9369063377380371, 0.7137135863304138, 0.34413760900497437, 0.3337826430797577, -0.5820906758308411, -0.6921719908714294, 0.3347419202327728, -0.503154456615448, 0.2248154729604721, -0.4605015814304352, 0.20472244918346405, 0.40635380148887634, -0.051765114068984985, -0.7850679755210876, 0.3646409809589386, 0.20034927129745483, -0.4200260639190674, 0.5683333873748779, -1.0993402004241943, 0.6781787872314453, 0.09903345257043839, -0.34663814306259155, 0.10369086265563965, -0.03766873851418495, -0.44107329845428467, -1.1975927352905273, 0.5578144788742065, -0.46891769766807556, -0.44773611426353455, 0.6376850008964539, 0.4684945344924927, 0.9928044080734253, 0.6646410226821899, -0.8922258019447327, -0.23283277451992035, 0.4056338965892792, -1.0003668069839478, 0.47850728034973145, 0.10171172022819519, 0.6212736964225769, -0.42510128021240234, 0.22904528677463531, -0.09197438508272171, 1.6107205152511597, -0.27380311489105225, 0.450664758682251, 1.501533031463623, 0.2382996380329132, -0.7642200589179993, 0.05433283746242523, -0.24995052814483643, -0.3194628059864044, 0.21322095394134521, -0.493648499250412, -1.3635014295578003, 1.2782706022262573, 0.277648389339447, -0.05927729606628418, 0.6456155776977539, -0.15754035115242004, -0.6622849702835083, 0.11037082970142365, -0.2897002100944519, -0.26604610681533813, 0.31247127056121826, -0.24864725768566132, -0.5165880918502808, 0.41634127497673035, -0.6707628965377808, -1.6228017807006836, 1.0185397863388062, -0.28624725341796875, -0.6552872657775879, -1.088039517402649, 0.09554211795330048, -0.9755457043647766, -0.7538893222808838, 0.6435701847076416, -0.2708231806755066, -0.16949988901615143, 0.7835307717323303, -0.8800982236862183, 0.03931359946727753, -0.12200632691383362, 0.19444838166236877, 0.45288312435150146, -0.41984349489212036, -1.5230826139450073, -0.3233061134815216, 0.23427045345306396, 0.08943960070610046, -0.7206481099128723, 0.7403677701950073, -0.06013757735490799, 0.36202511191368103, -0.4698246419429779, 0.12882979214191437, -0.22400006651878357, 1.3216925859451294, 0.4136629104614258, -1.3872039318084717, 0.6505013704299927, -0.3138388395309448, 0.616750955581665, 0.16954848170280457]\n"
     ]
    }
   ],
   "source": [
    "import ollama\n",
    "\n",
    "client = ollama.Client(host='http://192.168.20.43:11434')\n",
    "option = {\n",
    "    \"return_dense\": None,\n",
    "    \"return_sparse\": True,\n",
    "}\n",
    "embeddings = client.embeddings(\n",
    "    model='bge-m3:latest', \n",
    "    prompt='天空是蓝色的因为瑞利散射',\n",
    "\n",
    "    )\n",
    "\n",
    "\n",
    "print(embeddings)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
